{extend name="admin@index_layout"/}
{block name="main"}
<form class="layui-form" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label">模型名称</label>
        <div class="layui-input-inline">
            <input type="text" name="row[name]" lay-verify="required" autocomplete="off" placeholder="模型名称" class="layui-input" value="{$data.name}">
        </div>
        <div class="layui-form-mid layui-word-aux">模型中文名称，用于添加栏目时选择使用。</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">模型表键名</label>
        <div class="layui-input-inline">
            <input type="text" name="row[tablename]" lay-verify="required" autocomplete="off" placeholder="模型表键名" class="layui-input" value="{$data.tablename}">
        </div>
        <div class="layui-form-mid layui-word-aux">由小写字母组成</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">描述</label>
        <div class="layui-input-inline w300">
            <textarea name="row[description]" placeholder="模型的相关描述" class="layui-textarea">{$data.description}</textarea>
        </div>
    </div>
    <div class="layui-form-item web_list">
        <label class="layui-form-label">栏目模板</label>
        <div class="layui-input-inline w300">
            <select name="row[category_template]">
                <option value="category.html" selected>默认栏目首页:category.html</option>
                {volist name="tp_category" id="vo"}
                <option value="{$vo}" {eq name="data['setting']['category_template']" value="$vo" }selected{/eq}>{$vo}</option>
                {/volist}
            </select>
        </div>
        <div class="layui-form-mid layui-word-aux">新增模板以category_xx.html形式</div>
    </div>
    <div class="layui-form-item web_list">
        <label class="layui-form-label">列表模板</label>
        <div class="layui-input-inline w300">
            <select name="row[list_template]">
                <option value="list.html" selected>默认栏目列表页:list.html</option>
                {volist name="tp_list" id="vo"}
                <option value="{$vo}" {eq name="data['setting']['list_template']" value="$vo" }selected{/eq}>{$vo}</option>
                {/volist}
            </select>
        </div>
        <div class="layui-form-mid layui-word-aux">新增模板以list_xx.html形式</div>
    </div>
    <div class="layui-form-item web_list">
        <label class="layui-form-label">内容模板</label>
        <div class="layui-input-inline w300">
            <select name="row[show_template]">
                <option value="show.html" selected>默认内容页:show.html</option>
                {volist name="tp_show" id="vo"}
                <option value="{$vo}" {eq name="data['setting']['show_template']" value="$vo" }selected{/eq}>{$vo}</option>
                {/volist}
            </select>
        </div>
        <div class="layui-form-mid layui-word-aux">新增模板以show_xx.html形式</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-inline">
            <input type="radio" name="row[status]" value="1" title="正常" {if $data.status==1}checked{/if}>
            <input type="radio" name="row[status]" value="0" title="禁止" {if $data.status==0}checked{/if}>
        </div>
    </div>
    <input name="row[id]" type="hidden" value="{$data.id}">
    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit>立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
layui.use('yznForm', function() {
    var yznForm = layui.yznForm;
    yznForm.listen();
});
</script>
{/block}